#include <bits/stdc++.h>

using namespace std;

class MyQueue
{
public:
    MyQueue()
    {
    }

    void push(int x)
    {
        stk1.push(x);
    }

    int pop()
    {
        if (stk2.empty())
        {
            while (!stk1.empty())
            {
                stk2.push(stk1.top());
                stk1.pop();
            }
        }
        int res = stk2.top();
        stk2.pop();
        return res;
    }

    int peek()
    {
        int num = this->pop();
        stk2.push(num);
        return num;
    }

    bool empty()
    {
        if (stk1.empty() && stk2.empty())
        {
            return true;
        }
        else
        {
            return false;
        }
    }

public:
    stack<int> stk1;
    stack<int> stk2;
};

int main()
{
    MyQueue myQueue;
    myQueue.push(1);                 // queue is: [1]
    myQueue.push(2);                 // queue is: [1, 2] (leftmost is front of the queue)
    cout << myQueue.peek() << endl;  // return 1
    cout << myQueue.pop() << endl;   // return 1, queue is [2]
    cout << myQueue.empty() << endl; // return false
    return 0;
}